<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>任意波束形成</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="../static/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../static/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="../static/bower_components/Ionicons/css/ionicons.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" href="../static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">
  <!-- daterange picker -->
  <link rel="stylesheet" href="../static/bower_components/bootstrap-daterangepicker/daterangepicker.css">
  <!-- bootstrap datepicker -->
  <link rel="stylesheet" href="../static/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="../static/plugins/iCheck/all.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="../static/bower_components/select2/dist/css/select2.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
  <style type="text/css">
    #main{
      width: 1000px;
      height: 600px;
      border: 1px solid #000;
      margin: 100px auto;
      position: relative;
    }
    #horizon{
      position: absolute;
      left: 0px;
      top: 0px;
    }
    #horizon>div{
      position: absolute;
    }
  </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
    <a href="#" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini">超</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg">超声波成像系统平台</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!--导航栏信息，已经删除-->
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <!-- search form -->
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">

        <li><a href="${pageContext.request.contextPath}/main/medicalRecords"><i class="fa fa-circle-o"></i> 病人病历管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/medicalRecordsAnalysis"><i class="fa fa-circle-o"></i> 病人数据统计分析管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/imagingData"><i class="fa fa-circle-o"></i> 成像数据管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/projectManage"><i class="fa fa-circle-o"></i> 项目管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/commentManage"><i class="fa fa-circle-o"></i> 评价体系管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/logManage"><i class="fa fa-circle-o"></i> 平台日志信息管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/consumableMaterial"><i class="fa fa-circle-o"></i> 平台耗材管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/userManage"><i class="fa fa-circle-o"></i> 平台用户及权限管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/platformPortal"><i class="fa fa-circle-o"></i> 超声波成像系统平台门户</a></li>
        <li><a href="${pageContext.request.contextPath}/main/sendControl"><i class="fa fa-circle-o"></i> 多通道发射控制</a></li>
        <li><a href="${pageContext.request.contextPath}/main/receiveControl"><i class="fa fa-circle-o"></i> 多通道接收控制</a></li>
        <li><a href="${pageContext.request.contextPath}/main/syncControl"><i class="fa fa-circle-o"></i> 外部同步控制</a></li>
        <li><a href="${pageContext.request.contextPath}/main/dataCollect"><i class="fa fa-circle-o"></i> 数据采集与重建</a></li>
        <li><a href="${pageContext.request.contextPath}/main/waveGenerate"><i class="fa fa-circle-o"></i> 任意波束形成</a></li>
        <li><a href="${pageContext.request.contextPath}/main/scriptManage"><i class="fa fa-circle-o"></i> 超声探头脚本管理</a></li>
        <li><a href="${pageContext.request.contextPath}/main/createImgAlgorithm"><i class="fa fa-circle-o"></i> 成像模式算法</a></li>
        <li><a href="${pageContext.request.contextPath}/main/resolveImgAlgorithm"><i class="fa fa-circle-o"></i> 图像处理算法</a></li>
        <li><a href="${pageContext.request.contextPath}/main/patientManage"><i class="fa fa-circle-o"></i> 病人信息管理</a></li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        任意波束形成
        <small>详细信息</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li><a href="#">任意波束形成</a></li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <label class="box-title"><b>任意波束形成</b></label>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <br/>
              <div class="row">
                <div class="col-xs-2"><label>选择波形</label></div>
                <div class="col-xs-2">
                  <select class="form-control" id="myWaveSelect">
                    <option>波形1</option>
                    <option>波形2</option>
                    <option>波形3</option>
                  </select>
                </div>
                <div class="col-xs-2"><label>聚焦与偏转 (0.1左右):</label></div>
                <div class="col-xs-2">
                  <input type="text" name="" class="form-control" id="myX"/>
                </div>
                <div class="col-xs-2"><label>幅度变迹 (0.1左右):</label></div>
                <div class="col-xs-2">
                  <input type="text" name="" class="form-control" id="myY"/>
                </div>

              </div>
              <br/>
              <div class="row">
                <div class="col-xs-2"><label>主瓣宽度:</label></div>
                <div class="col-xs-2">
                  <input type="text" name="" class="form-control"/>
                </div>
                <div class="col-xs-2"><label>旁瓣宽度:</label></div>
                <div class="col-xs-2">
                  <input type="text" name="" class="form-control"/>
                </div>
              </div>


              <hr/>
              <div>
                <div class="col-xs-2">
                  <input type="button" value="确认"  class="btn btn-default" id="selectWaveType"  onclick="confirmWave()" />
                </div>

              </div>


                <div class="row">
                  <div id="main">
                    <div id="horizon"></div>
                  </div>
                </div>

              </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

        <div class="col-xs-2"></div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 1.0.0
    </div>
    <strong>Copyright &copy; 2018 <a href="#">上海大学 </a>.</strong> All rights
    reserved.
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Create the tabs -->
    <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
      <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
      <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
      <!-- Home tab content -->
      <div class="tab-pane" id="control-sidebar-home-tab">
        <h3 class="control-sidebar-heading">Recent Activity</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-birthday-cake bg-red"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                <p>Will be 23 on April 24th</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-user bg-yellow"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                <p>New phone +1(800)555-1234</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                <p>nora@example.com</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-file-code-o bg-green"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                <p>Execution time 5 seconds</p>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

        <h3 class="control-sidebar-heading">Tasks Progress</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Custom Template Design
                <span class="label label-danger pull-right">70%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Update Resume
                <span class="label label-success pull-right">95%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Laravel Integration
                <span class="label label-warning pull-right">50%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Back End Framework
                <span class="label label-primary pull-right">68%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

      </div>
      <!-- /.tab-pane -->
      <!-- Stats tab content -->
      <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
      <!-- /.tab-pane -->
      <!-- Settings tab content -->
      <div class="tab-pane" id="control-sidebar-settings-tab">
        <form method="post">
          <h3 class="control-sidebar-heading">General Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Report panel usage
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Some information about this general settings option
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Allow mail redirect
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Other sets of options are available
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Expose author name in posts
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Allow the user to show his name in blog posts
            </p>
          </div>
          <!-- /.form-group -->

          <h3 class="control-sidebar-heading">Chat Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Show me as online
              <input type="checkbox" class="pull-right" checked>
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Turn off notifications
              <input type="checkbox" class="pull-right">
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Delete chat history
              <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
            </label>
          </div>
          <!-- /.form-group -->
        </form>
      </div>
      <!-- /.tab-pane -->
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="../static/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="../static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="../static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="../static/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../static/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../static/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../static/dist/js/demo.js"></script>
<!-- page script -->
<!-- Select2 -->
<script src="../static/bower_components/select2/dist/js/select2.full.min.js"></script>
<!-- InputMask -->
<script src="../static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- date-range-picker -->
<script src="../static/bower_components/moment/min/moment.min.js"></script>
<script src="../static/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- bootstrap datepicker -->
<script src="../static/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- bootstrap color picker -->
<script src="../static/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<!-- bootstrap time picker -->
<script src="../static/plugins/timepicker/bootstrap-timepicker.min.js"></script>
<!-- iCheck 1.0.1 -->
<script src="../static/plugins/iCheck/icheck.min.js"></script>
<!-- ChartJS -->
<script src="../static/bower_components/chart.js/Chart.js"></script>

<!--echarts插件加载-->
<script src="../static/plugins/echarts/echarts.js"></script>
<%--画函数脚本--%>

<script type="text/javascript">
    function confirmWave(){
        var myWaveSelect = document.getElementById("myWaveSelect");
        var myX = document.getElementById("myX");
        var myY = document.getElementById("myY");
        var selectWaveStr = myWaveSelect.value;
        var selectX = Number(myX.value);
        var selectY = Number(myY.value);
        if(selectWaveStr === "波形1"){
            $("#horizon").empty();
            Sin.drawLine();
            Sin.drawSinWrap(1, selectX, selectY);
        }else if(selectWaveStr === "波形2"){
            $("#horizon").empty();
            Sin.drawLine();
            Sin.drawCosWrap(2, selectX, selectY);
        }else{
            $("#horizon").empty();
            Sin.drawLine();
            Sin.drawTanWrap(3, selectX, selectY);
        }

    }
</script>
<script type="text/javascript">
    // 根据id获得
    function fidId(str) {
        return document.getElementById(str);
    }
    var Sin = {
        // 获得宽度
        width: fidId("main").clientWidth,
        // 获得高度的1/2
        height: fidId("main").clientHeight / 2,
        // 生成直线
        drawLine: function() {
            for (var i = 0, arr = []; i < this.width + 1; i++) {
                arr[i] = this.createDiv(1,1,i,this.height,"#000");
            }
            fidId("horizon").innerHTML += arr.join("");
        },
        createDiv: function (w,h,x,y,color) {
            return "<div style='width:" + w + "px;height:" + h + "px;left:" + x +"px;top:" + y + "px;background:" + color + "'></div>"
        },
        // 生成正弦函数图像
        drawSinWrap: function(wave, selectX, selectY) {
            var num = 0;
            wave = !isNaN(wave) && wave > 0 ? wave : 0;
            for (var i = 0, arr = []; i < this.width; i++) {
                arr[i] = this.createDiv(2, 2, i += wave, parseInt(this.height + selectY * Math.sin(selectY/selectX * (num += .1)) * this.height), "red");
            }
            fidId("horizon").innerHTML += arr.join("");
        },
        // 生成余弦函数图像
        drawCosWrap: function(wave, selectX, selectY) {
            var num = 0;
            wave = !isNaN(wave) && wave > 0 ? wave : 0;
            for (var i = 0, arr = []; i < this.width; i++) {
                arr[i] = this.createDiv(2, 2, i += wave, parseInt(this.height + selectY * Math.log(selectY/selectX * (num += .1)) * this.height), "red");
            }
            fidId("horizon").innerHTML += arr.join("");
        },

        drawTanWrap: function(wave, selectX, selectY) {
            var num = 0;
            wave = !isNaN(wave) && wave > 0 ? wave : 0;
            for (var i = 0, arr = []; i < this.width; i++) {
                arr[i] = this.createDiv(2, 2, i += wave, parseInt(this.height + selectY * Math.cos(selectX/selectY * (num += .1)) * this.height), "red");
            }
            fidId("horizon").innerHTML += arr.join("");
        }


    }

</script>
</body>
</html>
